﻿

<!--********************* Part1:Jsp Head *********************-->

<%@ page contentType="text/html;charset=UTF-8"%>  
<%@ include file="/framework/head.jsp"%>

<!--********************* Part2:Java Code *********************-->
<%
	UserSearchEvent event = (UserSearchEvent)context.getSessionValue("UserSearchEvent");
	ObjectList list = User.fetch().search(con,event);
%>

<!--********************* Part3:JavaScript Code ***************-->
<!--start 客户端脚本区域-->
<script language=javascript>

var list_code = "listUser";

function doSearch()
{

	SetValue("s_Code",GetValue("i_Code")); //用户名
	SetValue("s_WarehouseCode",GetValue("i_WarehouseCode")); //仓库编码
	SetValue("s_Name",GetValue("i_Name")); //姓名
	SetValue("s_Status",GetValue("i_Status")); //是否有效
	SetValue("s_OrderField",GetValue("i_OrderField")); //排序
	SetValue("s_OrderDesc",getCheckBoxValues("i_OrderDesc")); //升降序
	doCommonSearch();
}

function bizViewUser(id)
{
	viewWin("<%=Config.getSrv()%>?action_code=viewUser&Id="+id);
}

function doDelete()
{
	if(!hasChooseRadio("ids"))
	{
		bizMessage("删除","操作员");
		return false;
	}
	if(!bizConfirm("删除","操作员")) return false;
	SetAction("deleteUser");
	frm.submit();
}

function doToAdd()
{
	SetAction("toAddUser");
	frm.submit();
}

function doToUpdate()
{
	if(!checkOne("ids")) 
	{
		bizMessage("修改","操作员");
		return false;
	}
	SetValue("Id",getCheckBoxValue("ids"));
	SetAction("toUpdateUser");
	frm.submit();
}

function doToCopy()
{
	if(!checkOne("ids")) 
	{
		bizMessage("复制","操作员");
		return false;
	}
	SetValue("Id",getCheckBoxValue("ids"));
	SetAction("toCopyUser");
	frm.submit();
}

function doSetFunc()
{
    if(!checkOne("ids")) 
    {
        bizMessage("权限设置","操作员");
        return false;
    }
    SetValue("userId",getCheckBoxValue("ids"));
    SetAction("toUserFuncSet");
    frm.submit();
}

key_InitDefault();
key_RegSubmitHandler(doSearch);
</script>


<%=uiBody%>>

<%@ include file="/framework/menu.jsp"%>

<!--********************* Part4:Form  ***************-->
<form id=frm action="<%=Config.getSrv()%>" method="post">
<input type=hidden name="action_code" value="">
<input type=hidden name="Id" value="">
<input type=hidden name=sortOrder value="1">
<input type=hidden name="userId" value="">

<!--查询条件保留区域-->


<input type=hidden name="s_Code" value="<%=event.getCode()%>"> <!--用户名-->

<input type=hidden name="s_WarehouseCode" value="<%=event.getWarehouseCode()%>"> <!--仓库编码-->

<input type=hidden name="s_Name" value="<%=event.getName()%>"> <!--姓名-->

<input type=hidden name="s_Status" value="<%=event.getStatus()%>"> <!--是否有效-->


<%@ include file="/framework/list_head.jsp"%>

<br>
<!--********************* Part5:Search Area ***************-->
<%=uiSearchStart%>>
<%
	int key_tab = 1 ;
%>

	<%=uiSearchInputTR%>>
		<%=uiSearchInputTDHead%>>
			所属仓库：
			<%=SelectManager.viewWarehouseSelect(con,loginInfo.getLoginWarehouseCode(),"i_WarehouseCode",event.viewWarehouseCode(),true,"",SelectManager.SELECT_ALL,"","key_tab="+(key_tab++))%>
			用&nbsp;户&nbsp;名：
			<input type="text" class="texts" name="i_Code" size="20" value="<%=event.viewCode()%>" key_tab="<%=key_tab++%>">
			姓&nbsp;&nbsp;&nbsp;&nbsp;名：
			<input type="text" class="texts" name="i_Name" size="20" value="<%=event.viewName()%>" key_tab="<%=key_tab++%>">
		</td>		
	</tr>

	<%=uiSearchInputTR%>>
		<%=uiSearchInputTDHead%>>
			有&nbsp;效&nbsp;性：
			<%=SelectManager.viewValidOrNoSelect("i_Status",event.viewStatus(),true,"",SelectManager.SELECT_ALL,"","key_tab="+(key_tab++))%>
		</td>		
	</tr>


	<%=uiSearchInputTR%>>
		<%=uiSearchInputTDHead%>>
			按&nbsp;排&nbsp;序：
			<select name="i_OrderField">
				<option value="" <%=(event.getOrderField().equals("1"))?"selected":""%>>设置排序字段</option>
				
				<option value="CODE" <%=(event.getOrderField().equals("CODE"))?"selected":""%>>用户名</option>
				
				<option value="WAREHOUSE_CODE" <%=(event.getOrderField().equals("WAREHOUSE_CODE"))?"selected":""%>>所属仓库</option>
	
				<option value="NAME" <%=(event.getOrderField().equals("NAME"))?"selected":""%>>姓名</option>
				
				<!-- <option value="TEL" <%=(event.getOrderField().equals("TEL"))?"selected":""%>>联系电话</option>
				
				<option value="MOBILE_PHONE" <%=(event.getOrderField().equals("MOBILE_PHONE"))?"selected":""%>>移动电话</option> -->
				
				<option value="STATUS" <%=(event.getOrderField().equals("STATUS"))?"selected":""%>>有效性</option>
				
			</select>
			&nbsp;&nbsp;
			<input type="radio" name="i_OrderDesc" value="false" <%=(event.isOrderDesc()==false)?"checked":""%> >升序
			<input type="radio" name="i_OrderDesc" value="true"  <%=(event.isOrderDesc()==true)?"checked":""%>  >降序
			<input type="button" value="查询" class="buttons" onclick="doSearch();return false;">&nbsp;<input type="button" value="清空" class="buttons" onclick="doClearEvent();return false;">
		</td>
	</tr>
      

<%=uiSearchEnd%>

<!--列表标题-->
<%=UIManager.addListHeadTitle("操作员列表")%>

<!--********************* Part6:List Area ***************-->

<%=uiListStart%>>

<%@ include file="/framework/list_foot.jsp"%>

<%
	int index = 1 ;
%>	
	<%=uiListHeadTR%>>
		<%=UIManager.addListHeadCheckBox() %>

		<%=UIManager.addListHead("所属仓库",index++)%>

		<%=UIManager.addListHead("用户名",index++)%>

		<%=UIManager.addListHead("姓名",index++)%>

		<%=UIManager.addListHead("有效性",index++)%>
     
		<%=UIManager.addListHead("操作",-1)%>  
	<%=uiListHeadTREnd%>>
	
	<!--data-->
<%
	for(int i=0;i<list.size();i++)
	{
		User obj = (User)list.get(i);
%>
	<%=uiListDataTR[i%2]%> align=center>
    	<%=uiListDataTD%>>
    		<input type="checkbox" name="ids" value="<%=obj.getId()%>">
    	</td>
    	
		<%=uiListDataTD%>><%=obj.viewWarehouseName(con)%>（<%=obj.getWarehouseCode()%>）</td>
     
    	<%=uiListDataTD%>><%=obj.viewCode(con)%></td>
    
    	<%=uiListDataTD%>><%=obj.viewName(con)%></td>
    
    	<%=uiListDataTD%>><%=obj.viewStatus(con)%></td>
        

    	<%=uiListDataTD%>>
    		<a href="" onclick="bizViewUser('<%=obj.getId()%>');return false;">浏览</a>
    	</td>
  	</tr>
<%	
	}
%>  

<%@ include file="/framework/list_foot2.jsp"%>

<%=uiListEnd%>


<!--********************* Part7:Action Area ***************-->
<%=uiCommandStart%>>
	<%=uiCommandTR%>>
		<%=uiCommandTD%>>
		<input type=button value="   添加   " class="buttons" onclick="doToAdd();return false;">
		<!--
		<input type=button value="   复制   " class="buttons" onclick="doToCopy();return false;">
		-->
		<input type=button value="   修改   " class="buttons" onclick="doToUpdate();return false;">
		<!-- <input type=button value="   删除　 " class="buttons" onclick="doDelete();return false;"> -->
        <input type=button value=" 设置权限 " class="buttons" onclick="doSetFunc();return false;">
		</td>
	</tr>	
<%=uiCommandEnd%>
</form>



<%@ include file="/framework/foot.jsp"%>

<!--
	Author    :justin
	FileName  :/system/base/UserList.jsp
-->
